export PATH=/usr/local/kaldi/tools/openfst-1.6.7/bin:$PATH
export PATH=/home/work_nfs5_ssd/pcguo/code/kaldi/src/fstbin:$PATH
export PATH=/home/work_nfs5_ssd/pcguo/code/kaldi/src/lmbin:$PATH
export PATH=/home/xlgeng/srilm/path/bin:$PATH
export PATH=/home/xlgeng/srilm/bin:$PATH
export PATH=/home/xlgeng/srilm/lm/bin/i686-m64:$PATH


unit_path=/home/work_nfs8/xlgeng/new_workspace/yhliang_template/wenet/examples/onlinesys/data/dict/lang_char.txt
world_list_path=/home/work_nfs8/xlgeng/new_workspace/wenet_gxl_en_cn_2/examples/aishell/s0/data_input/wordlist  # 只有纯粹的词，没虚词。 只要每行split之后的第一个是就行
bpe_model_path=/home/work_nfs8/xlgeng/new_workspace/wenet_gxl_en_cn_2/examples/aishell/s0/data_input/1000.model
#input_text_path=/home/work_nfs8/xlgeng/new_workspace/gxl_ai_utils/eggs/cats_and_dogs/ngram_task/data_handler/output_data/final_data.list
input_text_path=/home/work_nfs8/xlgeng/new_workspace/gxl_ai_utils/eggs/cats_and_dogs/prepare_data_for_en_cn/make_arpa/data_res/finall.txt
output_dir='./data_2gram_alldata'
output_lexison_path=${output_dir}/local/dict/lexicon.txt
cp $unit_path ${output_dir}/local/dict/units.txt


mkdir -p ${output_dir}/local/dict
python tools/fst/prepare_dict.py $unit_path $world_list_path $output_lexison_path $bpe_model_path

lm=${output_dir}/local/lm
mkdir -p $lm
# input_text_path是分过词的文本文件。
#input_text_path=/home/work_nfs8/xlgeng/new_workspace/gxl_ai_utils/eggs/cats_and_dogs/prepare_data_for_en_cn/make_arpa/data_res/finall.txt
cp $input_text_path $lm/text

# 训练ngram模型只需要文本和词典即可
local/aishell_train_lms.sh ${output_dir}/local/lm/text ${output_dir}/local/dict/lexicon.txt ${output_dir}/local/lm 3

